﻿@using AspNetCoreSpa.Application.Abstractions
@using AspNetCoreSpa.Infrastructure.Identity.Entities
@using Microsoft.AspNetCore.Identity
@inject IClientInfoService ClientInfoService
@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager

<ul class="navbar-nav">

    @if (SignInManager.IsSignedIn(User))
    {
        <li class="nav-item">
            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" asp-route-returnUrl="@Model" title="Manage">
                <i class="fas fa-user"></i>
                @User.Identity.Name
            </a>
        </li>
        <li class="nav-item">
            <form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Model">
                <button type="submit" class="nav-link btn btn-link text-dark">
                    <i class="fas fa-sign-out-alt"></i>
                    Logout
                </button>
            </form>
        </li>
    }
    else
    {
        <li class="nav-item">
            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register" asp-route-returnUrl="@Model">
                <i class="fas fa-user-plus"></i>
                Register
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login" asp-route-returnUrl="@Model">
                <i class="fas fa-sign-in-alt"></i>
                Login
            </a>
        </li>
    }
</ul>
